const User = require('./User')
const Material = require('./Material')
const WorkOrder = require('./WorkOrder')
const Process = require('./Process')
const Equipment = require('./Equipment')

// 定义关联关系
WorkOrder.belongsTo(Material, { foreignKey: 'productId', as: 'product' })
WorkOrder.belongsTo(Process, { foreignKey: 'processId', as: 'process' })
WorkOrder.belongsTo(Equipment, { foreignKey: 'equipmentId', as: 'equipment' })

module.exports = {
  User,
  Material,
  WorkOrder,
  Process,
  Equipment
}
